package com.koushare;

import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.koushare.entity.Teacher;
import com.koushare.entity.colleges.TestColleges;
import com.koushare.utils.HttpClientUtils;

import com.koushare.utils.ReptileUtils;


import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


/**
 * @ClassName TestApplication
 * @Description
 * @Author lidaofu
 * @Date 2022/5/17 14:48
 * @Version V1.0
 **/

public class TestApplication {
    public static void main(String[] args) {
        hkdxpy();
    }

    /**
     * 北京大学物理学院
     */
    public static void bdwl() {
        JSONObject jsonObject = HttpClientUtils.httpGet("https://www.phy.pku.edu.cn/system/resource/tsites/portal/queryteacher.jsp?collegeid=1520&isshowpage=false&postdutyid=0&postdutyname=&facultyid=&disciplineid=0&rankcode=0&jobtypecode=JOB_TYPE_ID927559%2C&enrollid=0&pageindex=1&pagesize=321&login=false&profilelen=10&honorid=0&pinyin=&teacherName=&searchDirection=&viewmode=10&viewOwner=1539754034&viewid=261388&siteOwner=1539754034&viewUniqueId=u12&showlang=zh_CN&actiontype=");
        JSONArray teacherData = jsonObject.getJSONArray("teacherData");
        List<Teacher> list = new ArrayList<>();
        for (Object teacherDatum : teacherData) {
            JSONObject teacherJson = (JSONObject) teacherDatum;
            Teacher teacher = new Teacher();
            teacher.setName(teacherJson.getString("name"));
            teacher.setUrl(teacherJson.getString("url"));
            teacher.setEmail(teacherJson.getString("email"));
            teacher.setPhone(teacherJson.getString("contact"));
            teacher.setColleges("北京大学物理学院" + teacherJson.getString("unit"));
            teacher.setUniversity("北京大学");
            list.add(teacher);
        }
        String fileName = "D:/teacher/北京大学物理学院" + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 北京大学化学与分子工程学院
     */
    public static void bdhxfz() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.chem.pku.edu.cn/szll/zzjs/index.htm");
        testColleges.setUniversity("北京大学");
        testColleges.setColleges("北京大学化学与分子工程学院");
        testColleges.setHrefCss("div[class=dWrap02] a");
        testColleges.setNameCss("title");
        testColleges.setEmailCss("div[class=article]");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }


    /**
     * 北京大学材料科学与工程学院
     */
    public static void bdmse() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("http://www.mse.pku.edu.cn/jzyg/zzjs.htm");
        testColleges.setUniversity("北京大学");
        testColleges.setColleges("北京大学材料科学与工程学院");
        testColleges.setHrefCss("div[class=list fl] a");
        testColleges.setNameCss("span[class=name]");
        testColleges.setEmailCss("div[class=t-info-text fl]");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 清华大学物理学系
     */
    public static void qhphys() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.phys.tsinghua.edu.cn/ry/jsfc/apysx.htm");
        testColleges.setUniversity("清华大学");
        testColleges.setColleges("清华大学物理学系");
        testColleges.setHrefCss("ul[class=teacher-list clearfix text-center] a");
        testColleges.setNameCss("div[class=teacher-name] a");
        testColleges.setEmailCss("div[class=teacher-p]");
        testColleges.setDirectionCss("div[class=jl-txt wow animated animated]");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 清华大学化学系
     */
    public static void qhchem() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.chem.tsinghua.edu.cn/szdw/zzjg/apypx1.htm");
        testColleges.setUniversity("清华大学");
        testColleges.setColleges("清华大学化学系");
        testColleges.setHrefCss("div[class=zhy_list] a");
        testColleges.setNameCss("title");
        testColleges.setEmailCss("div[class=Section1]");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 清华大学材料学院
     */
    public static void qhmse() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.mse.tsinghua.edu.cn/szqk/jsdw1.htm");
        testColleges.setUniversity("清华大学");
        testColleges.setColleges("清华大学材料学院");
        testColleges.setHrefCss("div[class=ul-box] a");
        testColleges.setNameCss("div[class=tname]");
        testColleges.setEmailCss("div[class=tcontent]");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 清华大学化学工程系
     */
    public static void qhchemeng() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.chemeng.tsinghua.edu.cn/szdw/sz1/aflck/zgj.htm");
        testColleges.setUniversity("清华大学");
        testColleges.setColleges("清华大学化学工程系");
        testColleges.setHrefCss("div[class=team-list] a");
        testColleges.setNameCss("title");
        testColleges.setEmailCss("tr[class=firstRow]");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 吉林大学物理学院--非首页
     */
    public static void jlph() {
        TestColleges testColleges = new TestColleges();
        List<Teacher> list = new ArrayList<>();
        for (int i = 1; i <= 19; i++) {
            testColleges.setStartUrl("https://phy.jlu.edu.cn/jzyg/jyry1/" + i + ".htm");

//        testColleges.setStartUrl("https://phy.jlu.edu.cn/jzyg/jyry1.htm");

            testColleges.setUniversity("吉林大学");
            testColleges.setColleges("吉林大学物理学院");
            testColleges.setHrefCss("div[class=\"js-list-box clearfix\"]");
            testColleges.setNameCss("div[class=js-name] a");
            testColleges.setEmailCss("div[class=js-list-right]");
            testColleges.setRexEmail(true);
            list.addAll(ReptileUtils.reptileOutSider(testColleges));

        }
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 吉林大学物理学院--非首页
     */
    public static void jlphsy() {
        TestColleges testColleges = new TestColleges();
        List<Teacher> list = new ArrayList<>();


        testColleges.setStartUrl("https://phy.jlu.edu.cn/jzyg/jyry1.htm");

        testColleges.setUniversity("吉林大学");
        testColleges.setColleges("吉林大学物理学院首页");
        testColleges.setHrefCss("div[class=\"js-list-box clearfix\"]");
        testColleges.setNameCss("div[class=js-name] a");
        testColleges.setEmailCss("div[class=js-list-right]");
        testColleges.setRexEmail(true);
        list.addAll(ReptileUtils.reptileOutSider(testColleges));


        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 吉林大学化学学院--非首页
     */
    public static void jlch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> allList = new ArrayList<>();
        testColleges.setStartUrl("https://chem.jlu.edu.cn/szll/zzjg1/apypx1.htm");
        testColleges.setUniversity("吉林大学");
        testColleges.setColleges("吉林大学化学工程系");
        testColleges.setHrefCss("div[class=tea-box clearfix active wow fadeInUp] a");
        testColleges.setNameCss("h1");//todo
        testColleges.setEmailCss("p[class=tit]");
        testColleges.setDirectionCss("div [class=jcrc-tit wow fadeInUp]研究方向 p");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        allList.addAll(list);
        {
            testColleges.setStartUrl("https://chem.jlu.edu.cn/szll/zzjg1/apypx1.htm");
            testColleges.setUniversity("吉林大学");
            testColleges.setColleges("吉林大学化学工程系");
            testColleges.setHrefCss("div[class=tea-box clearfix wow fadeInUp ] a");
            testColleges.setNameCss("h1");//todo
            testColleges.setEmailCss("p[class=tit]");
            testColleges.setDirectionCss("div [class=jcrc-tit wow fadeInUp]研究方向 p");
            testColleges.setRexEmail(true);

            List<Teacher> list1 = ReptileUtils.reptile(testColleges);
            allList.addAll(list1);
            System.out.println("本次爬取——" + list.size() + list1.size());
        }
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(allList);
    }

    /**
     * 吉林大学化工材料
     */
    public static void jlclhg() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("https://dmse.jlu.edu.cn/szdw/jsgk/bssds.htm");
        urlList.add("https://dmse.jlu.edu.cn/szdw/jsgk/js.htm");
        urlList.add("https://dmse.jlu.edu.cn/szdw/jsgk/yjy.htm");
        urlList.add("https://dmse.jlu.edu.cn/szdw/jsgk/fjs.htm");
        urlList.add("https://dmse.jlu.edu.cn/szdw/jsgk/fyjy.htm");
        urlList.add("https://dmse.jlu.edu.cn/szdw/jsgk/js1.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("吉林大学");
            testColleges.setColleges("吉林大学材料科学与工程学院");
            testColleges.setHrefCss("div[id=vsb_content] a");
            testColleges.setNameCss("div[class=tittle_con]");
            testColleges.setEmailCss("div[class=v_news_content]");
            testColleges.setPhoneCss("div[class=v_news_content]");
            testColleges.setRexEmail(true);

            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }


        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 山大物理
     */
    public static void sdwl() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.phy.sdu.edu.cn/szll/jzgyl.htm#");
        testColleges.setUniversity("山东大学");
        testColleges.setColleges("山东大学物理学院");
        testColleges.setHrefCss("div[id=vsb_content] a");
        testColleges.setNameCss("title");
        testColleges.setEmailCss("body");
        testColleges.setPhoneCss("body");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptileBoke(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 山大学化学工程系
     */
    public static void sdchemeng() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("https://www.chem.sdu.edu.cn/szdw/xssz.htm");
        testColleges.setUniversity("山东大学");
        testColleges.setColleges("山东大学化学工程系");
        testColleges.setHrefCss("div[id=category_teacher] a");
        testColleges.setNameCss("title");
        testColleges.setEmailCss("body");
        testColleges.setPhoneCss("body");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }

    /**
     * 山大山东大学材料学与工程学院
     */
    public static void sdcl() {
        TestColleges testColleges = new TestColleges();
        testColleges.setStartUrl("http://www.cmse.sdu.edu.cn/szll/xssz.htm");
        testColleges.setUniversity("山东大学");
        testColleges.setColleges("山东大学材料学与工程学院");
        testColleges.setHrefCss("div[class=char-tch] a");
        testColleges.setNameCss("div[class=contentTitle]");
        testColleges.setEmailCss("body");
        testColleges.setPhoneCss("body");
        testColleges.setRexEmail(true);
        List<Teacher> list = ReptileUtils.reptile(testColleges);
        System.out.println("本次爬取——" + list.size());
        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }


    /**
     * 南开大学化学学院
     */
    public static void nkpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("https://chem.nankai.edu.cn/hxx/main.htm");
        urlList.add("https://chem.nankai.edu.cn/yss/main.htm");
        urlList.add("https://chem.nankai.edu.cn/gfzs/main.htm");
        urlList.add("https://chem.nankai.edu.cn/yhs/main.htm");
        urlList.add("https://chem.nankai.edu.cn/fxkxzx/main.htm");
        urlList.add("https://chem.nankai.edu.cn/nygczx/main.htm");
        urlList.add("https://chem.nankai.edu.cn/_s312/jg/main.psp");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("南开大学");
            testColleges.setColleges("南开大学化学学院");
            testColleges.setHrefCss("div[class=page-con-area] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("body");
            testColleges.setPhoneCss("body");
            testColleges.setRexEmail(true);
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 南开大学材料科学与工程学院
     */
    public static void nkcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("https://mse.nankai.edu.cn/9281/list.htm");
        urlList.add("https://mse.nankai.edu.cn/9279/list.htm");
        urlList.add("https://mse.nankai.edu.cn/9280/list.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("南开大学");
            testColleges.setColleges("南开大学材料科学与工程学院");
            testColleges.setHrefCss("ul[class=news_list list2] a");
            testColleges.setNameCss("li[class=li_name]");
            testColleges.setEmailCss("body");
            testColleges.setPhoneCss("body");
            testColleges.setArea("022");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("span[style=color:#333333;font-family:cambria, 宋体;background-color:#fafafa;]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 哈工大化工与化学学院
     */
    public static void hgdch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("http://chemeng.hit.edu.cn/2495/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/2496/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/2498/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/2501/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/6420/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/6421/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/6422/list.htm");
        urlList.add("http://chemeng.hit.edu.cn/6423/list.htm");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("哈尔滨工业大学");
            testColleges.setColleges("哈工大化工与化学学院");
            testColleges.setHrefCss("div[id=wp_news_w6] a");
            testColleges.setNameCss("h1[class=arti_title]");
            testColleges.setEmailCss("body");
            testColleges.setPhoneCss("body");
            testColleges.setArea("0451");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("tr[style=height:19px;] span");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 哈工大化工与化学学院
     */
    public static void hgdcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("http://mse.hit.edu.cn/1720/list.htm");
        urlList.add("http://mse.hit.edu.cn/1721/list.htm");
        urlList.add("http://mse.hit.edu.cn/1722/list.htm");
        urlList.add("http://mse.hit.edu.cn/1728/list.htm");
        urlList.add("http://mse.hit.edu.cn/1764/list.htm");
        urlList.add("http://mse.hit.edu.cn/1765/list.htm");
        urlList.add("http://mse.hit.edu.cn/1766/list.htm");
        urlList.add("http://mse.hit.edu.cn/1767/list.htm");
        urlList.add("http://mse.hit.edu.cn/1768/list.htm");


        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("哈尔滨工业大学");
            testColleges.setColleges("哈工大材料科学与工程学院");
            testColleges.setHrefCss("div[id=wp_content_w7_0] a");
            testColleges.setNameCss("h3[class=tit chineseName]");
            testColleges.setEmailCss("div[class=cont]");
            testColleges.setPhoneCss("div[class=cont]");
            testColleges.setArea("0451");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 四川大学物理学院
     */
    public static void scwl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("https://physics.scu.edu.cn/jiaoshou/index.html");
        for (int i = 2; i <= 6; i++) {
            urlList.add("https://physics.scu.edu.cn/jiaoshou/index_" + i + ".html");
        }
        urlList.add("https://physics.scu.edu.cn/jiaoshoufu/index.html");
        urlList.add("https://physics.scu.edu.cn/jiaoshoufu/index_2.html");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("四川大学");
            testColleges.setColleges("四川大学物理学院");
            testColleges.setHrefCss("div[class=team] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=team-detail]");
            testColleges.setPhoneCss("div[class=team-detail]");
            testColleges.setArea("028");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 四川大学化学学院
     */
    public static void scch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("https://chem.scu.edu.cn/szll/szdwgk.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("四川大学");
            testColleges.setColleges("四川大学化学学院");
            testColleges.setHrefCss("div[class=list-right fr] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=teacher-right fl]");
            testColleges.setPhoneCss("div[class=teacher-right fl]");
            testColleges.setArea("028");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 四川大学材料与工程学院
     */
    public static void sccl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("https://mse.scu.edu.cn/szdw/js.htm");
        urlList.add("https://mse.scu.edu.cn/szdw/fjs.htm");
        urlList.add("https://mse.scu.edu.cn/szdw/bssds.htm");
        urlList.add("https://mse.scu.edu.cn/szdw/sssds.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("四川大学");
            testColleges.setColleges("四川大学材料与工程学院");
            testColleges.setHrefCss("div[class=xw] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[id=vsb_content]");
            testColleges.setPhoneCss("div[id=vsb_content]");
            testColleges.setArea("028");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 同济大学物理学院
     */
    public static void tjpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        for (int i = 15; i <= 19; i++) {
            urlList.add("http://physics.tongji.edu.cn/Web/Faculty/" + i + "");
        }

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("同济大学");
            testColleges.setColleges("同济大学物理学院");
            testColleges.setHrefCss("div[class=teacher_line] a");
            testColleges.setNameCss("span[style=font-size: 20px;padding-right:10px]");
            testColleges.setEmailCss("tbody");
            testColleges.setPhoneCss("tbody");
            testColleges.setArea("021");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 同济大学化学科学与工程学院
     */
    public static void tjch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://chemweb.tongji.edu.cn/szdw/js_yjy1.htm");
        urlList.add("https://chemweb.tongji.edu.cn/szdw/fjs_fyjy1.htm");
        urlList.add("https://chemweb.tongji.edu.cn/szdw/js_zljs1.htm");
        urlList.add("https://chemweb.tongji.edu.cn/szdw/qt1.htm");


        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("同济大学");
            testColleges.setColleges("同济大学化学科学与工程学院");
            testColleges.setHrefCss("div[class=vsb-space n_right] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=vsb-box]");
            testColleges.setPhoneCss("div[class=vsb-box]");
            testColleges.setArea("021");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 同济大学材料与工程学院
     */
    public static void tjcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://smse.tongji.edu.cn/szdw/jsjj/xb.htm");
        urlList.add("https://smse.tongji.edu.cn/szdw/jsjj/xb/1.htm");
        urlList.add("https://smse.tongji.edu.cn/szdw/jsjj/xb/2.htm");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("同济大学");
            testColleges.setColleges("同济大学材料与工程学院");
            testColleges.setHrefCss("ul[class=leaderListItem] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("body");
            testColleges.setPhoneCss("body");
            testColleges.setArea("021");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=user-label]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 厦门大学物理学院
     */
    public static void xdpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://phys.xmu.edu.cn/szdw1/zrjs/azc.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("厦门大学");
            testColleges.setColleges("厦门大学物理学院");
            testColleges.setHrefCss("div[class=list-r] a");
            testColleges.setNameCss("div[class=tit] h2");
            testColleges.setEmailCss("div[class=info]");
            testColleges.setPhoneCss("div[class=info]");
            testColleges.setArea("0592");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("span[class=r]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 厦门大学化学化工学院
     */
    public static void xdch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://chem.xmu.edu.cn/szdw1/jsdw.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("厦门大学");
            testColleges.setColleges("厦门大学化学化工学院");
            testColleges.setHrefCss("div[class=newslb] a");
            testColleges.setNameCss("form[name=_newscontent_fromname] h1");
            testColleges.setEmailCss("div[class=mainContent]");
            testColleges.setPhoneCss("div[class=mainContent]");
            testColleges.setArea("0592");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=r]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 厦门大学材料学院
     */
    public static void xdcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://cm.xmu.edu.cn/12303/list.htm");
        urlList.add("https://cm.xmu.edu.cn/12304/list.htm");
        urlList.add("https://cm.xmu.edu.cn/12304/list2.htm");
        urlList.add("https://cm.xmu.edu.cn/12305/list2.htm");
        urlList.add("https://cm.xmu.edu.cn/12305/list.htm");
        urlList.add("https://cm.xmu.edu.cn/12306/list.htm");
        for (int i = 2; i <= 4; i++) {
            urlList.add("https://cm.xmu.edu.cn/12303/list" + i + ".htm");
        }
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("厦门大学");
            testColleges.setColleges("厦门大学材料学院");
            testColleges.setHrefCss("div[class=col-md-9 col-sm-12 col-xs-12] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=teacher_detail]");
            testColleges.setPhoneCss("div[class=teacher_detail]");
            testColleges.setArea("0592");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("em[class=fa fa-codepen pr5] div");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 南方科技大学物理学院
     */
    public static void nkdpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        for (int i = 149; i <= 150; i++) {
            urlList.add("https://phy.sustech.edu.cn/faculty/index/cid/" + i + ".html?lang=zh-cn");
        }

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("南方科技大学");
            testColleges.setColleges("南方科技大学物理学院");
            testColleges.setHrefCss("div[class=content] a");
            testColleges.setNameCss("div[class=user] span");
            testColleges.setEmailCss("div[class=row]");
            testColleges.setPhoneCss("div[class=listBottom]");
            testColleges.setArea("0755");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("ul[class=pp_list1]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 南方科技大学材料科学与工程系
     */
    public static void nkdcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        urlList.add("http://mse.sustech.edu.cn/zh/Faculty/List/16");
        for (int i = 2; i <= 4; i++) {
            urlList.add("http://mse.sustech.edu.cn/zh/Faculty/List/16?page=" + i);
        }

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("南方科技大学");
            testColleges.setColleges("南方科技大学材料科学与工程系");
            testColleges.setHrefCss("li[class=col-xs-12 col-sm-4]");
            testColleges.setNameCss("div[class=tit]");
            testColleges.setEmailCss("li[class=col-xs-12 col-sm-4]");
            testColleges.setPhoneCss("li[class=col-xs-12 col-sm-4]");
            testColleges.setArea("0755");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("div[class=area]");
            List<Teacher> list = ReptileUtils.reptileOutSider(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 南方科技大学化学系
     */
    public static void nkdch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();
        JSONObject jsonObject = HttpClientUtils.httpGet("https://chem.sustech.edu.cn/Chemistry/public/index/Member/member_list?lang=cn&member_categoryid=8");
        JSONArray teacherData = jsonObject.getJSONArray("data");
        List<Teacher> list = new ArrayList<>();
        for (Object teacherDatum : teacherData) {
            JSONObject teacherJson = (JSONObject) teacherDatum;
            Teacher teacher = new Teacher();
            teacher.setName(teacherJson.getString("member_name"));
            teacher.setUrl(teacherJson.getString("member_profilepic"));
            teacher.setEmail(teacherJson.getString("member_email"));
            teacher.setPhone(teacherJson.getString("member_phone"));
            teacher.setDirection(teacherJson.getString("member_researchfield"));
            teacher.setColleges("南方科技大学化学系");
            teacher.setUniversity("南方科技大学");
            list.add(teacher);
        }
        String fileName = "D:/teacher/" + "南方科技大学化学系" + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
    }


    /**
     * 湖南大学物理与微电子科学学院
     */
    public static void hnpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://spe.hnu.edu.cn/jg/bmjg/dzkxyjsx.htm");
        urlList.add("http://spe.hnu.edu.cn/jg/bmjg/yywlx.htm");


        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("湖南大学");
            testColleges.setColleges("湖南大学物理与微电子科学学院");
            testColleges.setHrefCss("div[class=detailContent] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=centre]");
            testColleges.setPhoneCss("div[class=centre]");
            testColleges.setArea("0731");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=r]");
            List<Teacher> list = ReptileUtils.reptile(testColleges);
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 湖南大学化学化工学院
     */
    public static void hnch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://cc.hnu.edu.cn/szll/js.htm");
        urlList.add("http://cc.hnu.edu.cn/szll/fjs.htm");
        urlList.add("http://cc.hnu.edu.cn/szll/zljs.htm");
//        urlList.add("http://cc.hnu.edu.cn/szll/bszdjs.htm");
//        urlList.add("http://cc.hnu.edu.cn/szll/sszdjs.htm");


        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("湖南大学");
            testColleges.setColleges("湖南大学化学化工学院");
            testColleges.setHrefCss("div[class=XQ_main] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=wen_zi]");
            testColleges.setPhoneCss("div[class=wen_zi]");
            testColleges.setArea("0731");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=r]");
            List<Teacher> list = null;
            try {
                list = ReptileUtils.reptile(testColleges);
            } catch (Exception e) {
                e.printStackTrace();
            }
            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 湖南大学材料科学与工程学院
     */
    public static void hncl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://clxy.hnu.edu.cn/szdw/jszy.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("湖南大学");
            testColleges.setColleges("湖南大学材料科学与工程学院");
            testColleges.setHrefCss("div[class=XQ_main] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=wen_zi]");
            testColleges.setPhoneCss("div[class=wen_zi]");
            testColleges.setArea("0731");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=r]");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 兰州大学化学化工学院
     */
    public static void lzch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://chem.lzu.edu.cn/index.php?m=content&c=index&a=lists&catid=15");
        urlList.add("http://chem.lzu.edu.cn/index.php?m=content&c=index&a=lists&catid=16");
        urlList.add("http://chem.lzu.edu.cn/index.php?m=content&c=index&a=lists&catid=17");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("兰州大学");
            testColleges.setColleges("兰州大学化学化工学院");
            testColleges.setHrefCss("div[class=list_szdw] a");
            testColleges.setNameCss("div[class=main_renwu_er_title1] strong");
            testColleges.setEmailCss("div[class=main_renwu_er_left fl]");
            testColleges.setPhoneCss("div[class=main_renwu_er_left fl]");
            testColleges.setArea("0931");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("span[class=r]");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 兰州大学材料与能源学院
     */
    public static void lzcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://mat.lzu.edu.cn/shiziduiwu/jiaoshiduiwu/index.html");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("兰州大学");
            testColleges.setColleges("兰州大学材料与能源学院");
            testColleges.setHrefCss("div[class=rmain] a");
            testColleges.setNameCss("div[class=title] h2");
            testColleges.setEmailCss("div[class=intr]");
            testColleges.setPhoneCss("div[class=intr]");
            testColleges.setArea("0931");
            testColleges.setRexEmail(true);
            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 北航物理学院
     */
    public static void bhpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://physics.buaa.edu.cn/szll/wlx.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/yywlx.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/yywlx/1.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/hkxyjsx.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/hkxyjsx/1.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/hkxyjsx/2.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/wljxysyzx.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/wljxysyzx/1.htm");
        urlList.add("http://physics.buaa.edu.cn/szll/wljxysyzx/2.htm");
        for (int i = 1; i <= 4; i++) {
            urlList.add("http://physics.buaa.edu.cn/szll/wlx/" + i + ".htm");
        }

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("北京航空航天大学");
            testColleges.setColleges("北航物理学院");
            testColleges.setHrefCss("div[class=tuandui] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=main_content]");
            testColleges.setPhoneCss("div[class=main_content]");
            testColleges.setArea("010");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 北航化学学院
     */
    public static void bhch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://sce.buaa.edu.cn/szll/1.htm");
        urlList.add("http://sce.buaa.edu.cn/szll.htm");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("北京航空航天大学");
            testColleges.setColleges("北航化学学院");
            testColleges.setHrefCss("div[class=pic-list] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=grjj fl]");
            testColleges.setPhoneCss("div[class=grjj fl]");
            testColleges.setArea("010");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 北京航空航天大学材料科学与工程学院
     */
    public static void bhcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://www.mse.buaa.edu.cn/szdw/jslb.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("北京航空航天大学");
            testColleges.setColleges("北京航空航天大学材料科学与工程学院");
            testColleges.setHrefCss("div[class=textcon auto] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=rwjstop auto]");
            testColleges.setPhoneCss("div[class=rwjstop auto]");
            testColleges.setArea("010");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 北京理工大学物理学院
     */
    public static void blpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://physics.bit.edu.cn/szdw/zzjzg/index.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("北京理工大学");
            testColleges.setColleges("北京理工大学物理学院");
            testColleges.setHrefCss("div[class=box_list] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=wz_teacher]");
            testColleges.setPhoneCss("div[class=wz_teacher]");
            testColleges.setArea("010");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 北京理工大学材料学院
     */
    public static void blcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://mse.bit.edu.cn/szdw/jgml/index.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("北京理工大学");
            testColleges.setColleges("北京理工大学材料学院");
            testColleges.setHrefCss("div[class=profile] a");
            testColleges.setNameCss("p[class=anme gp-f18 gp-ellipsis]");
            testColleges.setEmailCss("div[class=sttuff]");
            testColleges.setPhoneCss("div[class=sttuff]");
            testColleges.setArea("010");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 苏州大学物理科学与技术学院
     */
    public static void szpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://physics.suda.edu.cn/1977/list.htm");
        urlList.add("http://physics.suda.edu.cn/1977/list2.htm");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("苏州大学");
            testColleges.setColleges("苏州大学物理科学与技术学院");
            testColleges.setHrefCss("div[class=col_news_list] a");
            testColleges.setNameCss("div[class=col_news_list] a");
            testColleges.setEmailCss("body");
            testColleges.setPhoneCss("body");
            testColleges.setArea("0512");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptileSZ(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 苏州大学材料与化学化工部
     */
    public static void szcl() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://chemistry.suda.edu.cn/szdw/list.htm");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("苏州大学");
            testColleges.setColleges("苏州大学材料与化学化工部");
            testColleges.setHrefCss("div[class=col-xs-12 col-sm-12 col-md-4 col-lg-4 column-teacher-item] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=wp_articlecontent]");
            testColleges.setPhoneCss("div[class=wp_articlecontent]");
            testColleges.setArea("0512");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }


    /**
     * 香港中文大学-理学院-物理系
     */
    public static void hkpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("http://www.phy.cuhk.edu.hk/people/teaching.html");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("香港中文大学");
            testColleges.setColleges("香港中文大学物理系");
            testColleges.setHrefCss("div[class=col-md-9 col-sm-8] a");
            testColleges.setNameCss("div[class=col-md-12 col-sm-12] h2");
            testColleges.setEmailCss("i[class=fa fa-envelope] td");
            testColleges.setPhoneCss("div[class=items-holder col-md-10 col-sm-10]");
            testColleges.setArea("852");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 香港中文大学-理学院-化学系
     */
    public static void hkch() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://chem.cuhk.edu.hk/people/academic-staff/");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("香港中文大学");
            testColleges.setColleges("香港中文大学-理学院-化学系");
            testColleges.setHrefCss("div[class=elementor-inner] a");
            testColleges.setNameCss("header[class=entry-header] h1");
            testColleges.setEmailCss("div[class=entry-content]");
            testColleges.setPhoneCss("div[class=entry-content]");
            testColleges.setArea("852");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 香港科技大学-理学院-物理系+化学系
     */
    public static void hkkj() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://chem.usthk.cn/people");

        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("香港科技大学");
            testColleges.setColleges("香港科技大学化学系");
            testColleges.setHrefCss("div[class=team-grid] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=contact]");
            testColleges.setPhoneCss("div[class=contact]");
            testColleges.setArea("852");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

    /**
     * 香港大学物理系
     */
    public static void hkdxpy() {
        TestColleges testColleges = new TestColleges();
        ArrayList<Teacher> arrayList = new ArrayList<>();
        ArrayList<String> urlList = new ArrayList<>();

        urlList.add("https://www.physics.hku.hk/people");
        for (String s : urlList) {
            testColleges.setStartUrl(s);
            testColleges.setUniversity("香港大学");
            testColleges.setColleges("香港大学物理系");
            testColleges.setHrefCss("table[class=staffTemplate1 staffContent] a");
            testColleges.setNameCss("title");
            testColleges.setEmailCss("div[class=mainContent]");
            testColleges.setPhoneCss("div[class=mainContent]");
            testColleges.setArea("010");
            testColleges.setRexEmail(true);
//            testColleges.setDirectionCss("li[text=研究方向：] span");
            List<Teacher> list = null;

            list = ReptileUtils.reptile(testColleges);

            arrayList.addAll(list);
            System.out.println("本次爬取——" + list.size());
        }

        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(arrayList);
    }

//    public static String pickUpPhoneNo() {
//        //⼿机号正则
//        String regExp = "(?:(0[0-9]{2,3}\\\\-?)?([2-9][0-9]{6,7})+(\\\\-[0-9]{1,4})?)|\" +\n" +
//                "        \"(?:(86-?)?(0[0-9]{2,4})?)";
//        Pattern phonePattern = Pattern.compile(regExp);
//        Matcher matcher = phonePattern.matcher("<span>0551-4493984");
//        while (matcher.find()) {
//            System.out.println(matcher.group());
//        }
//        return null;
//
//    }

//    /**
//     * 南开大学物理学院
//     */
//    public static void nkwl() {
//        ArrayList<String> jsonList = new ArrayList<>();
//        List<String> urlList = new ArrayList<>();
//        List<Teacher> list = new ArrayList<>();
//        jsonList.add("{\"total\":142,\"data\":[{\"columnId\":26206,\"siteId\":21,\"title\":\"薄方\",\"exField1\":\"博士生导师\",\"exField2\":\"光学\",\"exField3\":\"教授\",\"exField4\":\"光科学与技术系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/53/45/45ada69f4528bf7cd01da064fd5e/e7761d13-de4b-464f-b006-02da7b964d5d.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/bf/main.htm\"},{\"columnId\":26100,\"siteId\":21,\"title\":\"曹亚安\",\"exField1\":\"博士生导师\",\"exField2\":\"凝聚态物理\",\"exField3\":\"教授\",\"exField4\":\"凝聚态与材料物理系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/d8/7f/48a774ba49ed802c186294dcb0a5/d5d5d2ad-8f5e-44e5-a22f-c342a5474c50.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cya/main.htm\"},{\"columnId\":25875,\"siteId\":21,\"title\":\"陈璟\",\"exField1\":\"博士生导师\",\"exField2\":\"光学\",\"exField3\":\"教授\",\"exField4\":\"光科学与技术系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/20/a4/c0d5c98f4c7a9e977981412528fb/ad63c2c3-ed92-45f1-ba8f-3deff09b10b5.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cj/main.htm\"},{\"columnId\":26097,\"siteId\":21,\"title\":\"蔡卫\",\"exField1\":\"博士生导师\",\"exField2\":\"光学,光子学与光子技术,凝聚态物理\",\"exField3\":\"教授\",\"exField4\":\"光科学与技术系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/ac/7d/2cd9d7cc441498e1e55fa9beb585/80664b57-6b3a-4183-aebf-9df2c7f63df2.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cw/main.htm\"},{\"columnId\":25120,\"siteId\":21,\"title\":\"陈树琪\",\"exField1\":\"博士生导师\",\"exField2\":\"光学,凝聚态物理\",\"exField3\":\"教授\",\"exField4\":\"光科学与技术系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/6d/9d/bb6c0b4f47ce9364e07dce281746/1d0a0b51-025f-41d6-a175-4b4550f1e3f0.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/csq/main.htm\"},{\"columnId\":26145,\"siteId\":21,\"title\":\"陈志刚\",\"exField1\":\"博士生导师\",\"exField2\":\"光学,光子学与光子技术,凝聚态物理\",\"exField3\":\"教授\",\"exField4\":\"光科学与技术系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/19/8d/52b4d6b64452910f2845b4c6c138/b1df6638-0f5f-4cf8-825e-561e59e985c3.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/czg/main.htm\"},{\"columnId\":26142,\"siteId\":21,\"title\":\"陈宁\",\"exField1\":\"硕士生导师\",\"exField2\":\"理论物理\",\"exField3\":\"副教授\",\"exField4\":\"现代物理系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_res/articleType/teacher_CN.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cn/main.htm\"},{\"columnId\":26043,\"siteId\":21,\"title\":\"陈靖\",\"exField1\":\"无\",\"exField2\":\"无\",\"exField3\":\"副教授\",\"exField4\":\"实验教学中心\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_res/articleType/teacher_CN.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cj2/main.htm\"},{\"columnId\":25751,\"siteId\":21,\"title\":\"陈宗强\",\"exField1\":\"无\",\"exField2\":\"光学\",\"exField3\":\"高级实验师（副高）\",\"exField4\":\"实验教学中心\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/9f/ba/25c64ee84ec890e423047b0c3a29/05614c6e-9715-42ff-9cea-906f48b6b7ad.png\",\"cnUrl\":\"http://physics.nankai.edu.cn/czq/main.htm\"},{\"columnId\":25938,\"siteId\":21,\"title\":\"常雷\",\"exField1\":\"博士生导师\",\"exField2\":\"理论物理\",\"exField3\":\"教授\",\"exField4\":\"现代物理系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/84/6e/c53b54e84fac84aa4be3beda0841/de4dfafb-a572-442a-9bfc-8022098334bf.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cl/main.htm\"},{\"columnId\":25983,\"siteId\":21,\"title\":\"曹学伟\",\"exField1\":\"博士生导师\",\"exField2\":\"凝聚态物理\",\"exField3\":\"教授\",\"exField4\":\"凝聚态与材料物理系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/07/6d/ffb950ce4c2cadaafab8eb599808/d3008984-e7e7-42a3-8f53-c5c73cba4c82.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/cxw/main.htm\"},{\"columnId\":26103,\"siteId\":21,\"title\":\"程化\",\"exField1\":\"博士生导师\",\"exField2\":\"光学,光子学与光子技术\",\"exField3\":\"教授\",\"exField4\":\"光科学与技术系\",\"exField5\":\"物理学院\",\"department\":\"物理学院\",\"headerPic\":\"/_upload/article/images/d5/4e/7e5c0d704f2996da18e50abec2f5/bfd43df4-d48b-4935-8df8-0e3c264daeb4.jpg\",\"cnUrl\":\"http://physics.nankai.edu.cn/ch/main.htm\"}],\"lastPageNum\":10,\"pageCount\":12,\"endExeTime\":\"1.068\"}\n");
//        for (String s : jsonList) {
//            JSONObject jsonObject = JSONObject.parseObject(s);
//            JSONArray teacherData = jsonObject.getJSONArray("data");
//            for (Object teacherDatum : teacherData) {
//                JSONObject teacherJson = (JSONObject) teacherDatum;
//                String url = teacherJson.getString("cnUrl");
//                urlList.add(url);
//
//            }
//        }
//
//        System.out.println(urlList.size());
//
//        TestColleges testColleges = new TestColleges();
//        for (String s : urlList) {
//            testColleges.setStartUrl(s);
//            testColleges.setUniversity("南开大学");
//            testColleges.setColleges("南开大学物理学院");
////            testColleges.setHrefCss("div[class=teacher_line] a");
//            testColleges.setNameCss("span[class=tip tip0]");
//            testColleges.setEmailCss("body");
//            testColleges.setPhoneCss("body");
//            testColleges.setArea("022");
//            testColleges.setRexEmail(true);
////            testColleges.setDirectionCss("span[class=user-label]");
//            list.addAll(ReptileUtils.reptileOutSider(testColleges));
//            System.out.println("本次爬取——" + list.size());
//        }
//
//        String fileName = "D:/teacher/" + testColleges.getColleges() + ".xlsx";
//        EasyExcel.write(fileName, Teacher.class).sheet("模板").doWrite(list);
//
//    }
}
